//
//  Notification+Names.swift
//  GhostWorld
//
//  Created by Kam on 2018/4/3.
//  Copyright © 2018 LKGood. All rights reserved.
//

import Foundation

extension Notification.Name {
  static let backToLogin = Notification.Name("NotificationBackToLogin")
  static let didLogout = Notification.Name("NotificationDidLogout")
  static let changeNowPlaying = Notification.Name("NotificationChangeNowPlaying")
  static let updateNowPlayingProgress = Notification.Name("NotificationUpdateNowPlayingProgress")
  static let currentUserUpdated = Notification.Name("NotificationCurrentUserUpdated")
  
  static let downloadStarted = Notification.Name("NotificationDownloadStarted")
  static let downloadDidUpdateProgress = Notification.Name("NotificationDownloadDidUpdateProgress")
  static let downloadDidPaused = Notification.Name("NotificationDownloadDidPaused")
  static let downloadDidResumed = Notification.Name("NotificationDownloadDidResumed")
  static let downloadCanceled = Notification.Name("NotificationDownloadDidCanceled")
  static let downloadFinished = Notification.Name("NotificationDownloadDidFinished")
  static let downloadFailded = Notification.Name("NotificationDownloadDidFailed")
  static let downloadRemoved = Notification.Name("NotificationDownloadDidRemoved")
  static let streamingCacheFinished = Notification.Name("NotificationStreamingCacheFinihsed")
  
  static let nowPlayingMediaInfoChanged = Notification.Name("NotificationNowPlayingMediaInfoChanged")
  static let finishedAudioPlayingInList = Notification.Name("NotificationFinishedAudioPlayingInList")
  static let audioDidAddedToPlaylist = Notification.Name("NotificationAudioDidAddedToPlaylist")
  static let autoSleepCountDidChange = Notification.Name("NotificationAutoSleepCountDidChange")
  static let autoSleepDidEncountered = Notification.Name("NotificationAutoSleepDidEncountered")
  
  static let uploadTokenPurchaseInfoSuccess = Notification.Name("NotificationUploadTokenPurchaseInfoSuccess")
  static let tokenExchangeSuccess = Notification.Name("NotificationUploadTokenExchangeSuccess")
  
  static let reloadPurchasedHistory = Notification.Name("NotificationReloadPurchasedHistory")
    
    static let updateUserInfo = Notification.Name("updateUserInfo")
}

class DownloadNotificationObject {
  var downloadModel: MZDownloadModel!
  var index: Int = -1
  
  static let key = "DownloadNotificationObjectKey"
  
  init(downloadModel: MZDownloadModel, index: Int) {
    self.downloadModel = downloadModel
    self.index = index
  }
}

class UploadTokenPurchaseInfoNotificationObject {
  var listenerTotalTokenCount = 0
  
  static let key = "UploadTOkenPurchaseInfoNotificationObjectKey"
  
  init(listenerTotalTokenCount: Int) {
    self.listenerTotalTokenCount = listenerTotalTokenCount
  }
}
